<?php TPL::output('m/header.tpl.htm'); ?>

<!-- 标题 -->
<div class="aw-title">
	<?php _e('设置'); ?>
</div>
<!-- end 标题 -->

<!-- 内容 -->
<div class="container">
	<div class="aw-setting">
		<form action="account/ajax/privacy_setting/" method="post" id="setting_form">
			<!-- 微博设置 -->
			<div class="mod card-mod">
				<div class="mod-head">
					<h2>
						<?php _e('微博设置'); ?>
						<i class="icon icon-down pull-right"></i>
					</h2>
				</div>
				<div class="mod-body">
					<p class="color-666"><?php _e('是否允许别人访问我的微博'); ?>:</p>
					<ul>
						<li>
							<label>
								<?php _e('是'); ?>
								<input type="radio" value="1" class="pull-right" name="weibo_visit"<?php if ($this->user_info['weibo_visit'] == 1) { ?> checked="checked"<?php } ?> />
							</label>
						</li>
						<li>
							<label>
								<?php _e('否'); ?>
								<input type="radio" value="0" class="pull-right" name="weibo_visit"<?php if (!$this->user_info['weibo_visit']) { ?> checked="checked"<?php } ?> />
							</label>
						</li>
					</ul>
				</div>
			</div>
			<!-- end 微博设置 -->

			<!-- 私信设置 -->
			<div class="mod card-mod">
				<div class="mod-head">
					<h2>
						<?php _e('私信设置'); ?>
						<i class="icon icon-down pull-right"></i>
					</h2>
				</div>
				<div class="mod-body">
					<p class="color-666"><?php _e('谁可以给我发私信'); ?>:</p>
					<ul>
						<li>
							<label>
								<?php _e('所有人'); ?>
								<input type="radio" value="0" class="pull-right" name="inbox_recv"<?php if (!$this->user_info['inbox_recv']) { ?> checked="checked"<?php } ?> />
							</label>
						</li>
						<li>
							<label>
								<?php _e('我关注的人'); ?>
								<input type="radio" value="1" class="pull-right" name="inbox_recv"<?php if ($this->user_info['inbox_recv'] == 1) { ?> checked="checked"<?php } ?> />
							</label>
						</li>
					</ul>
				</div>
			</div>
			<!-- end 私信设置 -->

			<!-- 邮件设置 -->
			<div class="mod card-mod">
				<div class="mod-head">
					<h2>
						<?php _e('邮件设置'); ?>
						<i class="icon icon-down pull-right"></i>
					</h2>
				</div>
				<div class="mod-body">
					<p class="color-666"><?php _e('什么情况下给我发邮件'); ?></p>
					<ul>
						<li>
							<label>
								<?php _e('有人关注我'); ?>
								<input name="email_settings[]" value="FOLLOW_ME" class="pull-right" type="checkbox"<?php if ($this->user_info['email_settings']['FOLLOW_ME'] != 'N') { ?> checked="checked"<?php } ?> />
							</label>
						</li>
						<li>
							<label>
								<?php _e('有人邀请我回答问答问题'); ?>
								<input name="email_settings[]" value="QUESTION_INVITE" class="pull-right" type="checkbox"<?php if ($this->user_info['email_settings']['QUESTION_INVITE'] != 'N') { ?> checked="checked"<?php } ?> />
							</label>
						</li>
						<li>
							<label>
								<?php _e('我关注的问题有了新回复'); ?>
								<input name="email_settings[]" value="NEW_ANSWER" class="pull-right" type="checkbox"<?php if ($this->user_info['email_settings']['NEW_ANSWER'] != 'N') { ?> checked="checked"<?php } ?> />
							</label>
						</li>
						<li>
							<label>
								<?php _e('有人向我发私信'); ?>
								<input name="email_settings[]" value="NEW_MESSAGE" class="pull-right" type="checkbox"<?php if ($this->user_info['email_settings']['NEW_MESSAGE'] != 'N') { ?> checked="checked"<?php } ?> />
							</label>
						</li>
						<li>
							<label>
								<?php _e('我的问题被编辑'); ?>
								<input name="email_settings[]" value="QUESTION_MOD" class="pull-right" type="checkbox"<?php if ($this->user_info['email_settings']['QUESTION_MOD'] != 'N') { ?> checked="checked"<?php } ?> />
							</label>
						</li>
					</ul>
				</div>
			</div>
			<!-- end 邮件设置 -->

			<!-- 微信设置 -->
			<?php if (get_setting('weixin_app_id')) { ?>
			<div class="mod card-mod">
				<div class="mod-head">
					<h2>
						<?php _e('微信设置'); ?>
						<i class="icon icon-down pull-right"></i>
					</h2>
				</div>
				<div class="mod-body">
					<p class="color-666"><?php _e('什么情况下给我发送通知'); ?></p>
					<ul>
						<li>
							<label>
								<?php _e('当有人 @ 我'); ?>
								<input name="weixin_settings[]" value="AT_ME" class="pull-right" type="checkbox"<?php if ($this->user_info['weixin_settings']['AT_ME'] != 'N') { ?> checked="checked"<?php } ?> />
							</label>
						</li>
						<li>
							<label>
								<?php _e('我的问题有了新回复'); ?>
								<input name="weixin_settings[]" value="NEW_ANSWER" class="pull-right" type="checkbox"<?php if ($this->user_info['weixin_settings']['NEW_ANSWER'] != 'N') { ?> checked="checked"<?php } ?> />
							</label>
						</li>
						<li>
							<label>
								<?php _e('我的文章有了新评论'); ?>
								<input name="weixin_settings[]" value="NEW_ARTICLE_ANSWER" class="pull-right" type="checkbox"<?php if ($this->user_info['weixin_settings']['NEW_ARTICLE_ANSWER'] != 'N') { ?> checked="checked"<?php } ?> />
							</label>
						</li>
						<li>
							<label>
								<?php _e('我的回复有了新评论'); ?>
								<input name="weixin_settings[]" value="NEW_COMMENT" class="pull-right" type="checkbox"<?php if ($this->user_info['weixin_settings']['NEW_COMMENT'] != 'N') { ?> checked="checked"<?php } ?> />
							</label>
						</li>
					</ul>
				</div>
			</div>
			<?php } ?>
			<!-- end 微信设置 -->

			<!-- 通知设置 -->
			<div class="mod card-mod">
				<div class="mod-head">
					<h2>
						<?php _e('通知设置'); ?>
						<i class="icon icon-down pull-right"></i>
					</h2>
				</div>
				<div class="mod-body">
					<p class="color-666"><?php _e('什么情况下给我发送通知'); ?></p>
					<ul>
						<?php foreach($this->notify_actions as $key => $val) { ?>
		                    <?php if ($val['user_setting']) { ?>
		                    <li>
		                    	<label>
		                    		 <?php _e($val['desc']); ?>
		                    		 <input name="notification_settings[<?php echo $key;?>]" class="pull-right" type="checkbox" value="1"<?php if (!in_array($key, $this->notification_settings['data']) OR !$this->notification_settings['data']) { ?> checked="checked"<?php } ?> />
		                    	</label>
		                    </li>
		                    <?php } ?>
		                <?php } ?>
					</ul>
				</div>
			</div>
			<!-- end 通知设置 -->

			<!-- 保存设置 -->
			<div class="text-center">
				<a class="btn btn-success btn-slarge" onclick="AWS.ajax_post($('#setting_form'))"><?php _e('保存设置'); ?></a>
			</div>
			<!-- end 保存设置 -->
		</form>
	</div>
</div>
<!-- end 内容 -->

<script>
	$(function()
	{
		$('.aw-setting .mod-head').click(function()
		{
			if ($(this).parents('.card-mod').find('.mod-body').is(':visible'))
			{
				$(this).parents('.card-mod').find('.mod-body').hide();
				$(this).parents('.card-mod').find('.icon-down').removeClass('active');
			}
			else
			{
				$(this).parents('.card-mod').find('.mod-body').show();
				$(this).parents('.card-mod').find('.icon-down').addClass('active');
			}
		});
	});
</script>

<?php TPL::output('m/footer.tpl.htm'); ?>